package com.qf.controller;

import com.qf.dto.R;
import com.qf.pojo.Authors;
import com.qf.service.AuthorsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/author")
public class AuthorsController {
    private AuthorsService authorsService;
    @Autowired
    public void setAuthorsService(AuthorsService authorsService) {
        this.authorsService = authorsService;
    }

    @PostMapping("/newauthor")
    public R newcategory(@RequestBody Authors authors){

        authorsService.insertAuthors(authors);
        return R.setOk(authors);
    }
}
